public class test629 {
    public static boolean isPrime(int num) {
        if (num <= 1) return false;
        if (num == 2) return true;
        if (num % 2 == 0) return false;
        for (int i = 3; i <= Math.sqrt(num); i += 2) {
            if (num % i == 0) return false;
        }
        return true;
    }

    public static void main(String[] args) {
        for (int i = 2; i < 1000; i++) {
            int twin = i + 2;
            if (twin < 1000 && isPrime(i) && isPrime(twin)) {
                System.out.println("(" + i + ", " + twin + ")");
            }
        }
    }
}
